
#ifndef __CONFIG_H__
#define __CONFIG_H__

#pragma once

class CONFIG {
public:
   bool                 Load              (const char * filename);

   const dsSTRING &     GetValue          (const dsSTRING & section, const dsSTRING & key, const dsSTRING & defVal = dsSTRING()) const;
   int                  GetInt            (const dsSTRING & section, const dsSTRING & key, int defVal   = 0) const;
   float                GetFloat          (const dsSTRING & section, const dsSTRING & key, float defVal = 0.f) const;

private:
   typedef ds::MAP<dsSTRING, dsSTRING> STRING_MAP;

   struct SECTION {
      dsSTRING          name;
      STRING_MAP        keys;
   };
   typedef ds::MAP<dsSTRING, SECTION> SECTION_MAP;

   SECTION_MAP          sections;
};

#endif // __CONFIG_H__